$(function () { // onDomReady


module('Libs/utils');

test('Number', function () {
	ok((90).degree().toFixed(6) == (Math.PI/2).toFixed(6), 'degree()');
	ok((Math.PI/2).getDegree().round(8)  == 90, 'getDegree()');

	ok( (5).between(3, 6      ), 'between()');
	ok( (5).between(5, 8, 'L' ), 'between() {LeftEquals}');
	ok(!(5).between(5, 8, 'R' ), 'between() {RightNotEquals}');
	ok( (5).between(5, 8, true), 'between() {BothEquals}');
});


test('String', function () {
	ok(('test').repeat(2) === 'testtest', '.repeat()');
	ok(
		('"Hello, <World> & <People>!"').safeHTML() === '&quot;Hello, &lt;World&gt; &amp; &lt;People&gt;!&quot;',
	'safeHTML()');
	ok(('foo\nbar').nl2br() === 'foo<br/>\nbar', 'nl2br()');
	ok('abcdabcd'.replaceAll('c', 'X') === 'abXdabXd', 'replaceAll()');
	ok( ('foobar').begins('foo'), 'begins() {true}');
	ok(!('foobar').begins('bar'), 'begins() {false}');
	same(('abcd').toArray(), ['a','b','c','d'], 'toArray()');
});


test('Array', function () {
	same([1, 2, 3, 4, 5].remove(1), [1, 3, 4, 5], 'remove()');
	ok([1, 2, 3, 4, 5].sum() === 15, 'sum()');
	ok([1, 2, 3, 4, 5].average() === 3, 'average()');
	ok([false, null, 5, "fooo"].firstReal() ===    5, 'firstReal()');
	ok([false, null, undefined].firstReal() === null, 'firstReal() {false}');
});



});